-
-
Notifications
You must be signed in to change notification settings - Fork 8
feat(doctor): add comprehensive checks for v2.0+ features #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add diagnostic checks for new Matrix features: - Background Jobs: table existence, orphaned job cleanup - Hook Executions: session tracking table - Skills Directory: existence and skill count - Subagent Hooks: toolSearch config validation - Model Delegation: delegation config section - Dreamer Scheduler: tables and platform registration - File Suggestion: script installation and settings.json All checks include auto-fix capabilities where possible. Enhanced issue template with categorized checks and table summary.
Greptile SummaryThis PR significantly enhances the Matrix diagnostic tool by adding comprehensive health checks for all v2.0+ and v2.1+ features, with intelligent auto-fix capabilities. Key additions:
Auto-fix capabilities: Most issues are auto-fixable through migrations, directory creation, or config merging with defaults. The enhanced issue template now categorizes checks (core, database, hooks, config, features) for better bug reporting. Code quality: The implementation follows existing patterns, properly handles errors, and includes detailed comments. The checks are well-organized by category and version. Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Doctor as matrixDoctor()
participant Check as Check Functions
participant DB as Database
participant FS as File System
participant Config as Config System
participant Fix as attemptFix()
User->>Doctor: Call /matrix:doctor
Note over Doctor: Run all diagnostic checks
Doctor->>Check: checkMatrixDir()
Check->>FS: Verify ~/.claude/matrix exists
FS-->>Check: Status
Check-->>Doctor: DiagnosticCheck
Doctor->>Check: checkDatabase()
Check->>DB: Query schema version & health
DB-->>Check: Version & status
Check-->>Doctor: DiagnosticCheck
Doctor->>Check: checkBackgroundJobs()
Check->>DB: Check background_jobs table
Check->>DB: Query orphaned jobs
DB-->>Check: Table status & orphan count
Check-->>Doctor: DiagnosticCheck
Doctor->>Check: checkHookExecutions()
Check->>DB: Check hook_executions table
DB-->>Check: Table status
Check-->>Doctor: DiagnosticCheck
Doctor->>Check: checkSkillsDirectory()
Check->>FS: Verify ~/.claude/skills exists
Check->>FS: Count skill directories
FS-->>Check: Directory status & count
Check-->>Doctor: DiagnosticCheck
Doctor->>Check: checkSubagentHooks()
Check->>Config: Verify toolSearch config
Config-->>Check: Config status
Check-->>Doctor: DiagnosticCheck
Doctor->>Check: checkDelegation()
Check->>Config: Verify delegation config
Config-->>Check: Config status
Check-->>Doctor: DiagnosticCheck
Doctor->>Check: checkDreamer()
Check->>DB: Check dreamer_tasks table
Check->>DB: Check dreamer_executions table
Check->>DB: Count enabled tasks
Check->>FS: Verify platform scheduler (launchd/crontab)
FS-->>Check: Scheduler status
DB-->>Check: Table & task status
Check-->>Doctor: DiagnosticCheck
Doctor->>Check: checkFileSuggestion()
Check->>FS: Check file-suggestion.sh exists
Check->>FS: Check settings.json config
Check->>FS: Verify prerequisites (rg, fzf, jq)
FS-->>Check: Script & config status
Check-->>Doctor: DiagnosticCheck
Note over Doctor: Auto-fix if enabled
loop For each check with issues
Doctor->>Fix: attemptFix(check)
alt Background Jobs - orphaned
Fix->>DB: UPDATE background_jobs SET status='failed'
DB-->>Fix: Updated
else Missing database tables
Fix->>DB: runMigrations()
DB-->>Fix: Tables created
else Skills Directory missing
Fix->>FS: mkdirSync(SKILLS_DIR)
FS-->>Fix: Created
else Config sections missing
Fix->>Config: Merge with DEFAULT_CONFIG
Fix->>Config: saveConfig()
Config-->>Fix: Saved
else File Suggestion missing
Fix->>FS: Write file-suggestion.sh script
Fix->>FS: Update settings.json
FS-->>Fix: Installed
end
Fix-->>Doctor: Fixed check
end
Doctor->>Doctor: Generate issue template if unfixable issues
Doctor-->>User: DoctorResult with checks, fixes, and suggestions
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 file reviewed, 1 comment
|
Version files synced to 2.1.3 from CHANGELOG.md |
ojowwalker77
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jq reads from stdin by default - Claude Code pipes JSON to the script's stdin. No fix needed here.
Summary
New Diagnostic Checks
Features Audited
Test plan
bun run build)bun test)/matrix:doctorto verify new checks work